#ifndef QIPARSER
#define QIPARSER
#include <iostream>
#include <vector>
#include <map>

#include <boost/algorithm/string.hpp>
#include <boost/any.hpp>

#include "../../base/StringProcessor/StringProcessor.h"
#include "../../base/FileProcessor/FileProcessor.h"
#include "../../base/RequestParser/RequestParser.h"
#include "../../base/TemplateParser/QiGrammar.h"
#include "../../base/TemplateParser/BO.h"
#include "../../base/TemplateParser/Direction.h"
#include "../../base/TemplateParser/View.h"


//===========================================PARSER==========================================
namespace qiparser
{
//================function declaration=====================
std::string parsehtml(std::string);
void parse_direction(TemplateParser::BO::parsedirection &r);
template <typename Grammar>
bool grammarparse(string,const Grammar&, TemplateParser::BO::parsedirection&);
template <typename Grammar>
bool grammarparse(string,const Grammar&, TemplateParser::BO::parsedirection&, bool);
string removespace(string);
string removequote(string);
bool isstring(string);
string removeCurlyBracket(string);
//condition
bool parsecondition(string);
bool compare(TemplateParser::BO::parsedirection);
bool parseboolfunction(string,string);
bool parseintfunction(string,string,int&);
bool parsestringfunction(string,string,string&);
//operation
string parseoperation(string);
bool parseEqualOperation(string,string&);
//orther function
//int
boost::any getDataFromArr(boost::any, string);
boost::any getViewAnyData(string);
string getViewData(string);
boost::any setDataToArr(boost::any, string, boost::any);
void setViewData(string, boost::any);

string echo(string);
int convertInt(string);
bool convertBool(string);
bool parsefunction(TemplateParser::BO::parsedirection&);
//================direction process=====================
namespace DirectionProcess
{
void parseBlockNCondition(TemplateParser::BO::parsedirection &);


}







}
#endif
